Skip to content

refactor: project utils - #5569

Draft
brunozoric wants to merge 12 commits into
nextfrom
bruno/refactor/project-utils-testing
Draft

refactor: project utils#5569
brunozoric wants to merge 12 commits into
nextfrom
bruno/refactor/project-utils-testing

Conversation

@brunozoric

Copy link
Copy Markdown
Contributor

Changes

Remove project-utils usage from packages.

brunozoric and others added 4 commits August 11, 2026 22:43
getDocumentClient belongs in db-dynamodb, not api-core-ddb (avoids
circular dependency, correct abstraction level).
setupDynalite stays in project-utils (vitest singleton requirement).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove unnecessary @webiny/db-dynamodb devDep from api package.
Regenerate tsconfigs to clear stale api-core-ddb reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move createRunner/createMockTaskService to background-tasks/src/testing.
Move lifecycleTracker/sleep/until to api/src/testing.
Update all consumer imports (21 files).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@brunozoric
brunozoric force-pushed the bruno/refactor/project-utils-testing branch from 8f71216 to dc21aa7 Compare August 11, 2026 21:13
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

🚓 Slop Cop

⚠️ 3 thing(s) worth a look before merging.

The PR is a large, coherent multi-commit refactor that systematically moves testing utilities out of project-utils into more appropriate packages (api-core, db-dynamodb, background-tasks, api, api-opensearch-aws), matching its stated intent; the size (208 files) is explained by the mechanical nature of import-path updates and tsconfig/package.json path fixes across many packages, not by unrelated deletions.

🚨 Should this be in the PR?

🟡 Low — Unrelated dependency/version bumps included in refactor PR

Many package.json files across the repo have unrelated version bumps (e.g. cypress, nanoid, storybook, aws-sdk, next, oxlint, better-sqlite3, pg, tsx, etc.) alongside the project-utils migration. This is likely from a lockfile/deps update commit ('chore: update project-utils deps and lockfile') but inflates the diff far beyond the stated 'remove project-utils usage' intent. Not a red flag of accidental deletion, but reviewers should confirm these version bumps are intentional and not from a stale branch merge.

📏 Code-style rule checks

🟠 Medium — console.log used in simulateStream.ts error path

packages/api-opensearch-aws/src/testing/simulateStream.ts (new file) uses console.log(JSON.stringify(command)); in the catch block. While this is testing utility code (not strictly api-* backend runtime code), it's a stray debug statement carried over from the old project-utils code and should probably use a logger or be removed per no-console-in-backend.md intent (this package is api-opensearch-aws, an api-* package).

🟡 Low — Non-standard comment style in ExperimentsEditorPresenter.ts diff

packages/app-website-builder/.../ExperimentsEditorPresenter.ts shows a reformatting of .map() call (removing parens/indentation) unrelated to project-utils removal; not a rule violation per se, but appears to be unrelated formatting churn possibly from a lint/format pass, worth double-checking scope.

Automated, non-blocking heads-up from an LLM. It can be wrong — use your judgment. Regenerates on every push.

brunozoric and others added 8 commits August 11, 2026 23:25
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move setStorageOps/getStorageOps/clearStorageOps to api-core/src/testing.
Remove redundant root JS testing dirs (symlinks point to dist/).
Update all consumer imports (47 files).
Clean unused project-utils dep from api-headless-cms-testing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move setupDynalite to db-dynamodb/src/testing (TS, compiled to dist).
Singleton works via dist/ compiled JS (symlinks point to dist/).
api package keeps project-utils import to avoid circular dep chain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove tasks/, helpers/, dynamodb/ from project-utils/testing.
These now live in background-tasks, api, db-dynamodb, api-opensearch-aws.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
api package didn't need dynalite (no DynamoDB tests). Removed setup.
All consumers now use db-dynamodb/testing and api-core/testing.
project-utils/testing/ now only has presets/ and logger.js.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No consumers — was only used by setupDynalite which moved to db-dynamodb.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove unused dependencies from project-utils after testing migration.
Update references.json and yarn.lock.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant